home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4124 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  49 lines

  1. Newsgroups: comp.lang.c
  2. Path: uu4news.netcom.com!zodiac!szh
  3. From: szh@zcon.com (Syed Zaeem Hosain)
  4. Subject: Re: division problem
  5. Message-ID: <1996Feb2.020615.26648@zcon.com>
  6. Sender: szh@zcon.com (Syed Zaeem Hosain)
  7. Nntp-Posting-Host: zodiac
  8. Reply-To: szh@zcon.com
  9. Organization: Z Consulting Group
  10. References: <823118692snz@genesis.demon.co.uk>
  11. Date: Fri, 2 Feb 1996 02:06:15 GMT
  12.  
  13. In article <823118692snz@genesis.demon.co.uk>, Lawrence Kirby <fred@genesis.demon.co.uk> writes:
  14. >In article <4emuba$1mo@fountain.mindlink.net>
  15. >           genew@mindlink.bc.ca "Gene Wirchenko" writes:
  16. >
  17. >>>Still no need to use floating point,
  18. >>>celcius = ((fahrenheit - 32) * 5 + 4) / 9
  19. >>
  20. >>     Let's assume that you had never run across fahrenheit to celsius
  21. >>conversion before (because the above could just as easily be a case of
  22. >>converting flibbles to meeblesnauzers).
  23. >>
  24. >>     Can you derive the ORIGINAL formula for conversion of F to C?
  25. >>
  26. >>     If yes, how?  Because you don't know what the 4 is for.
  27. >
  28. >Maybe not but its effect is clearly one of rounding. Perhaps it would be
  29. >clearer to specify it as (9/2), perhaps not.
  30. >
  31. >>     If no, then it's unclear code, isn't it?
  32. >
  33. >How would you express it more clearly?
  34.  
  35. How about commenting the code well? We seem to want to find obscure
  36. methods to do things in the language (whatever it may be) without using
  37. the simpler systems that already exist!   :-)
  38.  
  39. I tend to like applying the KISS rule.
  40.  
  41.                                 Z
  42.  
  43.  
  44. -- 
  45. -------------------------------------------------------------------------
  46. | Syed Zaeem Hosain          P. O. Box 610097            (408) 441-7021 |
  47. | Z Consulting Group        San Jose, CA 95161             szh@zcon.com |
  48. -------------------------------------------------------------------------
  49.